package com.library.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.library.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 图书Mapper
 */
@Mapper
public interface BookMapper extends BaseMapper<Book> {
    
    /**
     * 分页查询图书（带分类名称）
     */
    Page<Book> selectBookPage(Page<Book> page, @Param("title") String title,
                               @Param("author") String author, @Param("categoryId") Long categoryId);
    
    /**
     * 获取热门图书
     */
    List<Book> selectHotBooks(@Param("limit") Integer limit);
}

